﻿@model PagedList.IPagedList<BB.Apostas.Models.Jogo>
<h2>Lista de Jogos</h2>
<p>
    @Html.ActionLink("Voltar", "Index")
</p>
<p>
    @Html.ActionLink("Novo Jogo", "CreateJogo")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().Id)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().CompeticaoId)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().JornadaId)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().HomeTeam)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().AwayTeam)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().Date)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().Fulfilled)
        </th>
        <th></th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Id)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Competicao.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Jornada.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.HomeTeam)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.AwayTeam)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Date)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Fulfilled)
            </td>
            <td>
                @Html.ActionLink("Editar", "EditJogo", new { id = item.Id }) |
                @Html.ActionLink("Remover", "DeleteJogo", new { id = item.Id })
            </td>
        </tr>
    }
    <tfoot>
        <tr>
            <td colspan="8">
                @Html.Partial("_PagingPartial")
            </td>
        </tr>
    </tfoot>
</table>
